package com.lyh.common.enums;

//预约状态
public enum PurchaseStatusEnum {

    WAIT_AUDIT(0, "待审核"),
    AUDIT(1, "审核通过"),
    PURCHASE_FAIL(2, "预约失败"),
    BD_SUCCESS(3, "保单成功");

    Integer code;

    String name;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    PurchaseStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static PurchaseStatusEnum getEnum(Integer code) {
        for (PurchaseStatusEnum el : PurchaseStatusEnum.values()) {
            if (el.getCode()==code) {
                return el;
            }
        }

        return null;
    }
}
